
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton title="#{messages['button.new']}" icon="ui-icon-document" action="#{funcionarioListMB.getNextView}"
						actionListener="#{funcionarioListMB.clear}" ajax="false" />

					<p:commandButton title="#{messages['button.delete']}" icon="ui-icon-trash" onclick="confirmation.show()"
						type="button" immediate="true" ajax="false" />

					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.alert']}!" severity="alert" widgetVar="confirmation">

						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{funcionarioListMB.deleteSelection}"
							actionListener="#{funcionarioListMB.clear}" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>
			<p:dataTable id="list" var="bean" value="#{funcionarioListMB.resultList}">
				<f:facet name="header">#{messages['funcionario.list.table.title']}</f:facet>
				<p:column style="width:2%;">
					<h:selectBooleanCheckbox value="#{funcionarioListMB.selection[bean.id]}"></h:selectBooleanCheckbox>
				</p:column>
				
				<p:column style="width:5%;" sortBy="#{bean.id}">
					<f:facet name="header">#{messages['funcionario.label.id']}</f:facet>
					<h:outputText value="#{bean.id}" />
				</p:column>
						
				<p:column sortBy="#{bean.funcao}">
					<f:facet name="header">#{messages['funcionario.label.funcao']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.funcao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.especialidade}">
					<f:facet name="header">#{messages['funcionario.label.especialidade']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.especialidade}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.crm}">
					<f:facet name="header">#{messages['funcionario.label.crm']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.crm}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.nome}">
					<f:facet name="header">#{messages['funcionario.label.nome']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.nome}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.cpf}">
					<f:facet name="header">#{messages['funcionario.label.cpf']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.cpf}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.rg}">
					<f:facet name="header">#{messages['funcionario.label.rg']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.rg}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.cep}">
					<f:facet name="header">#{messages['funcionario.label.cep']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.cep}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.endereco}">
					<f:facet name="header">#{messages['funcionario.label.endereco']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.endereco}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.numero}">
					<f:facet name="header">#{messages['funcionario.label.numero']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.numero}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.complemento}">
					<f:facet name="header">#{messages['funcionario.label.complemento']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.complemento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.cidade}">
					<f:facet name="header">#{messages['funcionario.label.cidade']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.cidade}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.estado}">
					<f:facet name="header">#{messages['funcionario.label.estado']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.estado}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.telefone}">
					<f:facet name="header">#{messages['funcionario.label.telefone']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.telefone}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.dataNascimento}">
					<f:facet name="header">#{messages['funcionario.label.dataNascimento']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.dataNascimento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.idade}">
					<f:facet name="header">#{messages['funcionario.label.idade']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.idade}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.genero}">
					<f:facet name="header">#{messages['funcionario.label.genero']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.genero}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.nomeMae}">
					<f:facet name="header">#{messages['funcionario.label.nomeMae']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.nomeMae}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
				<p:column sortBy="#{bean.nomePai}">
					<f:facet name="header">#{messages['funcionario.label.nomePai']}</f:facet>
					<h:commandLink action="#{funcionarioListMB.getNextView}" actionListener="#{funcionarioListMB.clear}">
						<h:outputText value="#{bean.nomePai}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
					
			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>